package com.campus.service.impl;

import com.campus.dao.ClassDao;
import com.campus.model.Class;
import com.campus.model.TeachingStudentInClass;
import com.campus.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {

    private final ClassDao classDao;

    @Autowired
    public ClassServiceImpl(ClassDao classDao) {
        this.classDao = classDao;
    }

    @Override
    public int createClass(Class cls) {
        return classDao.createClass(cls);
    }

    @Override
    public int updateClass(Class cls) {
        return classDao.updateClass(cls);
    }

    @Override
    public int addStudentsToClass(int classId, List<Integer> studentIds) {
        return classDao.addStudentsToClass(classId, studentIds);
    }

    @Override
    public int assignTeachersToClass(int classId, List<Integer> teacherIds) {
        return classDao.assignTeachersToClass(classId, teacherIds);
    }
}
